﻿<%--//------------------------------------------------------------------------------
// IdeaSparx.CoolControls.Web
// Author: John Eric Sobrepena (2010)
// You can use these codes in whole or in parts without warranty.
// http://johnsobrepena.blogspot.com
//--------------------------------------------------------------------------------%>

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" EnableTheming="true"
    Theme="Gradient" Inherits="IdeaSparx.CoolControls.Website._Default" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<%@ Register Assembly="IdeaSparx.CoolControls.Web" Namespace="IdeaSparx.CoolControls.Web"
    TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <base target="_self" />
    <title>CoolGridView</title>
    <!-- Sample CSS style for CoolGridView which gives 3D effects on Headers -->
    <style type="text/css">
        .hiddencol
        {
            display: none;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="margin-left: 30px; margin-top: 30px;">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            Spacer</div>
        <div>
            Spacer<br />
            Spacer<br />
        </div>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:MultiView ID="MultiView1" ActiveViewIndex="0" runat="server">
                    <asp:View ID="View1" runat="server">
                        <cc1:CoolGridView ID="CoolGridView1" runat="server" AutoGenerateColumns="False" AllowSorting="True"
                            Height="300px" Width="400px" AllowPaging="true" ShowFooter="true" PageSize="15"
                            EmptyDataText="No Data to Display" DefaultColumnWidth="100px" CellPadding="0" ViewMode="Hierarchical">
                            <Columns>
                                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID">
                                    <HeaderStyle Width="120px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name">
                                    <HeaderStyle Width="200px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Tax ID" HeaderText="Tax ID" SortExpression="Tax ID">
                                    <HeaderStyle Width="350px" />
                                </asp:BoundField>
                            </Columns>
                            <ChildTemplate>
                                <asp:TextBox ID="TextBox11" runat="server">Sample Child</asp:TextBox>
                            </ChildTemplate>
                            <BoundaryStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                        </cc1:CoolGridView>
                        <br />
                        Click on the button to go to the next view (AJAX)
                        <asp:Button ID="btnNext" runat="server" OnClick="Next" Text="Next"></asp:Button>
                    </asp:View>
                    <asp:View ID="View2" runat="server">
                        <cc1:CoolGridView ID="CoolGridView2" runat="server" AutoGenerateColumns="False" AllowSorting="False"
                            Height="300px" Width="400px" AllowPaging="false" EmptyDataText="No Data to Display">
                            <Columns>
                                <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID">
                                    <HeaderStyle Width="120px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name">
                                    <HeaderStyle Width="200px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="Tax ID" HeaderText="Tax ID" SortExpression="Tax ID">
                                    <HeaderStyle Width="350px" />
                                </asp:BoundField>
                            </Columns>
                        </cc1:CoolGridView>
                        <br />
                        Click on the button to go back (AJAX)
                        <asp:Button ID="btnBack" runat="server" OnClick="Back" Text="back"></asp:Button>
                    </asp:View>
                </asp:MultiView>
            </ContentTemplate>
        </asp:UpdatePanel>
        <br />
        <asp:Button ID="btnPostBack" runat="server" Text="Do PostBack"></asp:Button>
        <br />
        <table>
            <tr>
                <td>
                    <cool:CoolGridView ID="CoolGridView3" runat="server" EnableTheming="false" AutoGenerateColumns="False"
                        AllowSorting="False" Height="400px" Width="600px" AllowPaging="true" EmptyDataText="No Data to Display"
                        PagerSettings-Mode="NextPreviousFirstLast" PagerSettings-Position="Bottom" PageSize="15"
                        OnRowCreated="CoolGridView3_RowCreated" AllowResizeColumn="false" OnRowDataBound="CoolGridView3_RowDataBound"
                        DefaultColumnWidth="200px">
                        <Columns>
                            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID">
                                <HeaderStyle Width="70px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name">
                                <HeaderStyle Width="500px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="Tax ID" HeaderText="Tax ID" SortExpression="Tax ID">
                                <HeaderStyle Width="270px" />
                            </asp:BoundField>
                            <asp:TemplateField>
                                <HeaderStyle Width="170px" />
                                <ItemTemplate>
                                    <asp:TextBox runat="server" ID="TextBox10" Text=""></asp:TextBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField SortExpression="ID">
                                <HeaderStyle Width="70px" />
                                <HeaderTemplate>
                                    <span>ID</span></HeaderTemplate>
                                <ItemTemplate>
                                    <span>
                                        <%# Eval("ID") %></span>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField SortExpression="Tax ID">
                                <HeaderStyle Width="70px" />
                                <HeaderTemplate>
                                    <span>Tax ID</span></HeaderTemplate>
                                <ItemTemplate>
                                    <span>
                                        <%# Eval("Tax ID") %></span>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Mode="NextPreviousFirstLast"></PagerSettings>
                    </cool:CoolGridView>
                    l
                </td>
            </tr>
        </table>
        <a href="javascript:TestInModalPopup();">Launch CoolGridView in modal window</a>
    </div>
    </form>

    <script type="text/javascript" language="javascript">
        function TestInModalPopup() {
            window.showModalDialog("Default.aspx", "Modal Window", "dialogWidth:850px; dialogHeight:700px; center:yes");
        }
    </script>

</body>
</html>
